from applications.radio.modules import committees

def apply():
    """/radio/committees/join
    current user applying for committee with given id"""
    c_id = request.vars.get("id")
    return committees.apply(c_id) 

def index():
    """/radio/committees/index"""
    return committees.index()

def admin():
    """/radio/committees/admin
    directors only"""
    #TODO: get real user_id of current logged on user and make sure
    #user is a director
    user_id = 1
    return committees.admin(user_id)

def demote():
    """/radio/committees/demote/committee_id/user_id
    directors only"""
    c_id = request.args(0)
    user_id = request.args(1)
    return "demoted user %s on committee %s" % (user_id, c_id)

def promote():
    """/radio/committees/promote/committee_id/user_id
    directors only"""
    c_id = request.args(0)
    user_id = request.args(1)
    return "promoted user %s on committee %s" % (user_id, c_id)
